checksumutils: Support splicing stream to arbitrary checksum type
authorColin Walters <walters@verbum.org>
Thu, 15 Jan 2015 03:01:54 +0000 (22:01 -0500)
committerColin Walters <walters@verbum.org>
Thu, 15 Jan 2015 03:01:54 +0000 (22:01 -0500)
This will be used later by the metalink code; you can splice with a
NULL output stream to an arbitrary GChecksum instead of just a SHA256
one.

src/libotutil/ot-checksum-utils.c

index b7289929c659281db281348e6a9f0103ae94c588..c1335fa276673b094912a692f32e5996b359b548 100644 (file)
@@ -92,7 +92,7 @@ ot_gio_splice_update_checksum (GOutputStream  *out,
         }
       while (bytes_read > 0);
     }
-  else
+  else if (out != NULL)
     {
       if (g_output_stream_splice (out, in, 0, cancellable, error) < 0)
         goto out;